<%@page language="java" contentType="text/html"  pageEncoding="UTF-8"%>
<%@page import="db.DBManager, java.sql.*"%>
<html><head><title>ユーザーリスト</title></head><body><h1>ユーザーリスト</h1>
<%	Connection con = DBManager.getConnection();
	Statement stmt = con.createStatement();
	ResultSet rs = stmt.executeQuery("select id, name from UserAccount");
%><table border= "1"><%
	ResultSetMetaData resMetaData = rs.getMetaData();
%><tr><td><b>ID</b></td><td><b>NAME</b></td><td colspan="2"><b>変更</b></td></tr><%
	while (rs.next()) {
%><tr><%
		out.print("<td>" + rs.getString(1) + "</td>");
		out.print("<td>" + rs.getString(2) + "</td>");
		out.print("<td><a href=\"./edit/UserEditServlet?id=" + rs.getString(1) + "\">編集</a></td>");
		out.print("<td><a href=\"./delete/UserDeleteServlet?id=" + rs.getString(1));
		out.print("\" onClick=\"return confirm('ユーザー削除')\">削除</a></td>");
%></tr><%
	}
%></table><%
	rs.close();
	stmt.close();
	con.close();
%><a href="entry/UserEntryServlet">新規登録</a>
</body></html>